home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 20
/
Cream of the Crop 20 (Terry Blount) (1996).iso
/
bbs
/
maxut11.zip
/
MSGLST00.MEX
< prev
next >
Wrap
Text File
|
1996-06-20
|
14KB
|
446 lines
//////////////////////////////////////////////////////////////////////////////
// File: arealist.mex
//
// Desc: Program to display a list of message or file areas. If the
// MSGAREA constant is defined, this will display a list of
// message areas. If FILEAREA is defined, this will display
// a list of file areas.
// Copyright 1990, 1995 by Lanius Corporation. All rights reserved.
//
// Free for non-commerical use
// $Id: msglst00.mex 0.0 1996/01/07 17:48:05 sjd Exp $
// Copyright , 1995 1996 by Gerry Ellison. All rights reserved.
// change to print and write to.
// M_Alst03.bbs", Squish.add", TimLst.add" 12/21/1995 Gerry Ellison
// Use M\msglst00_CON or M\msglst00_WRT
//////////////////////////////////////////////////////////////////////////////
#include <max.mh>
#define MSGAREA
#ifdef FILEAREA
#define ATYPE "file"
#define AREAT _farea
#define ARVAR farea
#define AreaFindFirst fileareafindfirst
#define AreaFindNext fileareafindnext
#define AreaFindClose fileareafindclose
#define AreaSelect fileareaselect
#endif
#ifdef MSGAREA
#define ATYPE "msg"
#define AREAT _marea
#define ARVAR marea
#define AreaFindFirst msgareafindfirst
#define AreaFindNext msgareafindnext
#define AreaFindClose msgareafindclose
#define AreaSelect msgareaselect
#endif
int isourdivision(string: divstr, string: areaname)
{
int: l;
string: sub;
l:=strlen(divstr);
sub:=substr(areaname,1,l);
if (strupper(sub)<>strupper(divstr))
return False;
sub:=substr(areaname,l+2,strlen(areaname)-l-1);
if (stridx(sub,1,'.'))
return False;
return True;
}
int main(string: argv)
// int main()
{
int: fd,cn; // for write
int: done, i, levels, first, divonly;
string: aname,division,tmp;
char: nonstop,ch;
// added to print and write C:\Max\Miscx\M_Alst03.bbs
string: S,A,B,D,F,G,GT,GF,GI,GN,GS,H,L,M,N,O,R,T,V,W,GR,WM,LS,RS,line;
string: z,tagtp,type,nodes,TMT; // for squish and timed list
struct AREAT: a;
first:= True;
divonly:= False;
// added to print and write C:\Max\Miscx\M_Alst03.bbs
GR := "\x16\x01\x07";
WM := "\x16\x01\x5F";
LS := WM+"░░░▒▒▒▓▓▓████";
RS := "████▓▓▓▒▒▒░░░"+GR;
// TMT:= LS+" TMT: Local "+RS;
A := LS+" Compression and Archiver Software."+RS;
B := LS+" Bulletin Board information msg. "+RS;
D := LS+" Disabled Message Areas. "+RS;
F := LS+" For Sale Local and National. "+RS;
GT := LS+" Genealogy Echo Mail messages. "+RS;
GF := LS+" Fido Net International Genealogy "+RS;
GI := LS+"IGA_Net<tm> International Genealogy"+RS;
GN := LS+" NNS: Non-Network Specific. "+RS;
GS := LS+" GensysOp Area. "+RS;
H := LS+" Ham Radio Echo Mail messages. "+RS;
L := LS+" Languages, & Batch Aids Messages. "+RS;
M := LS+" Modems and Communication Messages."+RS;
N := LS+" Networks and Multtasking. "+RS;
O := LS+" OS2 Messages. "+RS;
R := LS+" Rest of Groups not listed. "+RS;
T := LS+" Tech type messages. "+RS;
V := LS+" Virus Message Conference. "+RS;
W := LS+" Microsoft Windows. "+RS;
S := LS+" SysOp and Work File Areas. "+RS;
// 1st end to print and write C:\Max\Miscx\M_Alst03.bbs
print(COL_YELLOW+"\nConstructing Message.lst, Squish.cfg and Timed.cfg "+
GR);
if (argv <> "WRT") {
ch := input_list("yn", 0, "", "",
"\nDo you want to print to con");
if (ch = 89)
argv := "CON";
}
fd := open("C:\\Max\\Miscx\\M_Alst03.bbs", IOPEN_CREATE | IOPEN_WRITE);
close(fd);
fd := open("C:\\Bbs\\Squish\\Squish.add", IOPEN_CREATE | IOPEN_WRITE);
close(fd);
fd := open("C:\\Bbs\\Squish\\Timed\\TimLst.add", IOPEN_CREATE | IOPEN_WRITE);
close(fd);
// Set initial division name
i:=strridx(ARVAR.name,0,'.');
if (i>0)
division:=substr(ARVAR.name,1,i-1);
else
division:="";
do
{
int: len;
len := input_str(aname, INPUT_WORD|INPUT_NOCTRLC|INPUT_DEFAULT,
0, 64, COL_WHITE "\nSelect " ATYPE " area: ");
print('\n');
if (len=0)
{
if (first<>True)
return 0;
aname:="?";
}
if (aname="..")
{
i:=stridx(division,1,'.');
if (i>0)
division:=substr(division,1,i-1);
else
division:="";
aname:="?";
}
if (aname[1]='/') // Top level list requested
{
aname:=substr(aname,2,strlen(aname)-1);
// List all top level areas
division:="";
if (aname[1]=' ')
aname:="?";
}
first:=False;
divonly:=False;
if (aname[1]='?') // Area list requested
{
aname:=division;
// List just current division
i:=AreaFindFirst(a, aname, AFFO_DIV) and (division="" OR a.division);
divonly:=True;
}
else if (aname[1]='=')
{
aname:="";
// List all areas regardless of division
i:=AreaFindFirst(a, aname, AFFO_NODIV);
}
else
{
if (division[1]=' ')
i:=AreaFindFirst(a, aname, AFFO_DIV);
else
{
tmp:=division+"."+aname;
i:=AreaFindFirst(a, tmp, AFFO_DIV);
if (i=False)
i:=AreaFindFirst(a, aname, AFFO_DIV);
}
if (i=False)
print("Search on '", aname, "' failed.\n");
else
{ // It's a division, so list all of it
if (a.division)
{
divonly:=True;
division:=a.name;
}
else
{
AreaSelect(aname);
return 0;
}
}
}
// If listing only the division, skip past the division record
if (i and divonly and division[1]<>' ')
i:=AreaFindNext(a);
levels:=1;
reset_more(nonstop);
while (i and do_more(nonstop, COL_CYAN) and levels)
{
if (a.division=2)
{
if (divonly)
levels:=levels-1;
}
else
{
if (divonly and a.division=1)
levels:=levels+1;
if (divonly=False OR isourdivision(division, a.name))
// added to print and write C:\Max\Miscx\M_Alst03.bbs
if (argv <> "CON") {
if (cn >0 and cn <10)
z := "\b";
if (cn >10 or cn >100)
z := "\b\b";
if (cn >100)
z := "\b\b\b";
if (cn = 0)
print("Area # ");
print(z,cn);
cn := cn + 1;
}
fd := open("C:\\Max\\Miscx\\M_Alst03.bbs", IOPEN_APPEND | IOPEN_WRITE);
line := "";
if (strupper(substr(a.name,2,2)) = "S" or
strupper(substr(a.name,1,1)) = "S")
tmp := "a100/"+substr(a.name,1,1);
else if (strupper(substr(a.name,1,1)) = "E" and strlen(a.name)=1)
tmp := "a0/"+substr(a.name,1,1);
else
tmp := "a20/"+substr(a.name,1,1);
if (strlen(a.name)=1) {
if (strupper(a.name)="E")
line := TMT;
if (strupper(a.name)="A")
line := A;
else if( strupper(a.name)="B")
line := B;
else if( strupper(a.name)="D")
line := D;
else if( strupper(a.name)="F")
line := F;
else if( strupper(a.name)="G")
line := G;
else if( strupper(a.name)="H")
line := H;
else if( strupper(a.name)="L")
line := L;
else if( strupper(a.name)="M")
line := M;
else if( strupper(a.name)="N")
line := N;
else if( strupper(a.name)="O")
line := O;
else if( strupper(a.name)="R")
line := R;
else if( strupper(a.name)="T")
line := T;
else if( strupper(a.name)="V")
line := V;
else if( strupper(a.name)="W")
line := W;